#include "stdafx.h"
#include "BaseFun.h"

NAMESPACE_CORE_BEGIN

int_32 Int32High(int_32 iVal)
{
	return (int_32)((int_16)UInt32High((uint_32)iVal));
}
int_32 Int32Low(int_32 iVal)
{
	return (int_32)((int_16)UInt32High((uint_32)iVal));
}
uint_32 UInt32High(uint_32 uiVal)
{
	return uiVal >> 16;
}
uint_32 UInt32Low(uint_32 uiVal)
{
	return uiVal & 0xFFFF;
}

int_64 Int64High(int_64 iVal)
{
	return (int_64)((int_32)UInt64High((uint_64)iVal));
}
int_64 Int64Low(int_64 iVal)
{
	return (int_64)((int_32)UInt64High((uint_64)iVal));
}
uint_64 UInt64High(uint_64 uiVal)
{
	return uiVal >> 32;
}
uint_64 UInt64Low(uint_64 uiVal)
{
	return uiVal & 0xFFFF;
}


int_x IntXLow(int_x iVal)
{
#ifdef BIT_64
	return Int64High(iVal);
#else
	return Int32High(iVal);
#endif
}
uint_x UIntXLow(uint_x uiVal)
{
#ifdef BIT_64
	return UInt64Low(uiVal);
#else
	return UInt32Low(uiVal);
#endif
}
NAMESPACE_CORE_END
